Skip to content

Conversation

@traviscross
Copy link
Contributor

Currently, for macro_use, the last macro imported wins. This may be something that we consider to be a bug. Rather than documenting this normatively, then, let's stay normatively silent on that behavior and document the details of the situation with rustc in an admonition.

cc @ehuss @petrochenkov #1886 (comment)

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 22, 2025
Comment on lines 395 to 396
> [!NOTE]
> `rustc` currently prefers the last macro in case of conflict. Don't rely on this. This behavior is unusual, as imports in Rust are generally order-independent. This behavior of `macro_use` may change in the future.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a good issue to cite for this, we can cite it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened rust-lang/rust#148025 for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Added it here.

Currently, for `macro_use`, the last macro imported wins.  This may
be something that we consider to be a bug.  Rather than documenting
this normatively, then, let's stay normatively silent on that behavior
and document the details of the situation with `rustc` in an
admonition.
@traviscross traviscross force-pushed the TC/loosen-mbe-last-macro-imported-wins branch from 5b19599 to d5c876c Compare October 28, 2025 20:22
@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss added this pull request to the merge queue Oct 28, 2025
Merged via the queue into master with commit 9768e0e Oct 28, 2025
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants